package de.unidue.langtech.teaching.pp.example;

import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.jcas.JCas;

import ude.DetectedTweetAtmosphere;


/**
 * The baseline classifies every tweet as the majority class "neutral"
 * 
 * @author Zesch, adapted by Marco
 *
 */
public class BaselineTwitter
    extends JCasAnnotator_ImplBase
{
	 @Override
	    public void initialize(UimaContext context)
	       
	    {
	        System.out.println("Baseline is running. Every Tweet will be classified as neutral -> majority class");  
	    }
	 
    @Override
    public void process(JCas jcas)
        throws AnalysisEngineProcessException
    {
        DetectedTweetAtmosphere detectedAtmosphere = new DetectedTweetAtmosphere(jcas);
        detectedAtmosphere.setAtmosphere("\"neutral\"");
        detectedAtmosphere.addToIndexes();
    }
    
    @Override
    public void collectionProcessComplete()
        throws AnalysisEngineProcessException
    {
        super.collectionProcessComplete();
        System.out.println("***************************************************");
        System.out.println("*Baseline classification process succesfully done!*");
        System.out.println("***************************************************");
    }
}